package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.MDCGroup;
import com.dhcc.DRGsHosp.facade.dto.MDCGroupDTO;

public class MDCGroupAssembler {
	
	public static MDCGroupDTO  toDTO(MDCGroup  mDCGroup){
		if (mDCGroup == null) {
			return null;
		}
    	MDCGroupDTO result  = new MDCGroupDTO();
	    	result.setMdcCode (mDCGroup.getMdcCode());
     	    	result.setVerCode (mDCGroup.getVerCode());
     	    	result.setMdcDesc (mDCGroup.getMdcDesc());
     	    return result;
	 }
	
	public static List<MDCGroupDTO>  toDTOs(Collection<MDCGroup>  mDCGroups){
		if (mDCGroups == null) {
			return null;
		}
		List<MDCGroupDTO> results = new ArrayList<MDCGroupDTO>();
		for (MDCGroup each : mDCGroups) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static MDCGroup  toEntity(MDCGroupDTO  mDCGroupDTO){
	 	if (mDCGroupDTO == null) {
			return null;
		}
	 	MDCGroup result  = new MDCGroup();
        result.setMdcCode (mDCGroupDTO.getMdcCode());
         result.setVerCode (mDCGroupDTO.getVerCode());
         result.setMdcDesc (mDCGroupDTO.getMdcDesc());
 	  	return result;
	 }
	
	public static List<MDCGroup> toEntities(Collection<MDCGroupDTO> mDCGroupDTOs) {
		if (mDCGroupDTOs == null) {
			return null;
		}
		
		List<MDCGroup> results = new ArrayList<MDCGroup>();
		for (MDCGroupDTO each : mDCGroupDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
